<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
                xmlns:sf="http://www.springframework.org/tags/faces"
                xmlns:sec="http://www.springframework.org/security/facelets/tags"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
				template="/WEB-INF/layouts/template.xhtml">

<ui:define name="main">
<script type="text/javascript">document.getElementById('menuProjects').className="selected";</script>
<div id="main">
	<div id="wrapper" class="yui-b">
		<h3 class="title">${msg.title_project}</h3>
		<div id="mainContent">
			<h:form id="projects">
			    <h:dataTable id="projects" styleClass="summary" value="${projects}" var="p" rendered="${projects.rowCount > 0}" >
			    	<h:column>
			    		<f:facet name="header">${msg.name}</f:facet>
			    		<sf:commandLink id="viewProjectLink" action="select">${p.name}</sf:commandLink>
			    	</h:column>
			    	<h:column>
			    		<f:facet name="header">${msg.description}</f:facet>
			    		${p.description}
			    	</h:column>
			    	<h:column>
			    		<f:facet name="header"></f:facet>
			    		<h:outputText rendered="${p.retired}">${msg.retired}</h:outputText>
			    	</h:column>
			    </h:dataTable>
			    <h:outputText value="${msg.project_noProjects}" rendered="${projects.rowCount == 0}"/>
			    <sec:ifAnyGranted roles="ROLE_ADMIN">
				    <div>
			    		<sf:commandLink id="add" action="add"><div class="button">${msg.add} ${msg.project}</div></sf:commandLink>
			    	</div>
			    	<div style="clear: both;" />
			    </sec:ifAnyGranted>
		    </h:form>
	    </div>
    </div>
    <div style="clear: both; height: 5px;" />
</div>
</ui:define>
</ui:composition>